/*
 * HelloController.java
 * Copyright 2020 Qunhe Tech, all rights reserved.
 * Qunhe PROPRIETARY/CONFIDENTIAL, any form of usage is subject to approval.
 */

package com.lixinlei.tech.ex.handler.controller;

import com.lixinlei.tech.ex.handler.ex.BusinessException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Function: 就是一个 Controller
 *
 * @author wali
 * @date 2020/11/2
 */
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello() {
        return "hello-world";
    }

    @GetMapping("/ex")
    public void exception() {
        throw new RuntimeException("runtime");
    }

    @GetMapping("/bs")
    public String business() {
        throw new BusinessException();
    }

}
